<template>
  <div>
      
      <a-form-model-item label="用户名">
        <a-input v-model="username" placeholder="输入用户名"/>
      </a-form-model-item>
      <a-form-model-item label="密 码">
        <a-input v-model="password" type="password" placeholder="输入密码"/>
      </a-form-model-item>
      <a-form-model-item label="手机号">
        <a-input v-model="phone" placeholder="输入手机号"/>
      </a-form-model-item>

      <a-form-model-item >
        <a-button @click="put" type="primary">
          修改
        </a-button>
      </a-form-model-item>
  </div>
</template>
<script>
import axios from 'axios'

export default {
  data() {
    return {
      username: '', 
      password: '', 
      phone: '', 
      id : ''
    };
  },
  methods: {
      put(){
          this.$axios.put('selectuser/?id='+this.id,{
              'username':this.username,
              'password':this.password,
              'phone':this.phone
          }).then(res=>{
              console.log(res.data);
          })
      }
  },
  created() {
      this.id=this.$route.query.id
  }
};
</script>